<html>
<script>
function selectOpt5() {
    document.getElementById("opt5").selected = true;
}
function selectOpt6() {
    document.getElementById("opt5").selected = false;
    document.getElementById("opt6").selected = true;
}
</script>
<body>
<button onclick="selectOpt5();">Select option 5</button>
<button onclick="selectOpt6();">Select option 6</button>
<select multiple="multiple" size="4">
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
<option>option 4</option>
<option id="opt5">option 5</option>
<option id="opt6">option 6</option>
<option>option 7</option>
</select>
</body>
</html>
